import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import { RenderType } from '@pkg/setting';

export const columns: BasicColumn[] = [
  {
    title: '发票抬头',
    dataIndex: 'invoiceTitle',
    width: 150,
  },
  {
    title: '抬头类型',
    dataIndex: 'invoiceType',
    width: 120,
    dictData: [
      { label: '个人', value: 1,color:'blue' },
      { label: '企业', value: 2 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '发票金额',
    dataIndex: 'invoiceAmount',
    width: 120,
  },
  {
    title: '企业税号',
    dataIndex: 'creditCode',
    width: 120,
  },
  {
    title: '收票人电话',
    dataIndex: 'telephone',
    width: 120,
  },
  {
    title: '收票人邮箱',
    dataIndex: 'email',
    width: 120,
  },
  {
    title: '申请日期',
    dataIndex: 'createTime',
    width: 140,
  },
  {
    title: '开票状态',
    dataIndex: 'invoiceState',
    width: 100,
    dictData: [
      { label: '未开票', value: 0 },
      { label: '已开票', value: 1 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '备注',
    dataIndex: 'remark',
    align: 'left',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [

  {
    field: 'invoiceTitle',
    label: '发票抬头',
    component: 'Input',
  },
  {
    field: 'invoiceState',
    label: '开票状态',
    component: 'Select',
    componentProps: {
      options: [
        { label: '未开票', value: 0 },
        { label: '已开票', value: 1 },
      ],
    },
  },
];
export const formSchema: FormSchema[] = [
  {
    field: 'invoiceType',
    label: '抬头类型',
    component: 'ApiRadioGroup',
    componentProps: {
      options: [
        { label: '个人', value: 1 },
        { label: '企业', value: 2 },
      ],
    },
  },
  {
    label: '企业税号',
    field: 'creditCode',
    component: 'Input',
    ifShow: ({ values }) => values.invoiceType==2,
  },
  {
    label: '发票抬头',
    field: 'invoiceTitle',
    component: 'Input',
  },
  {
    field: 'invoiceKind',
    label: '发票类型',
    component: 'ApiRadioGroup',
    componentProps: {
      options: [
        { label: '普票', value: 1 },
      ],
    },
  },
  {
    label: '发票金额',
    field: 'invoiceAmount',
    component: 'Input',
  },
  {
    label: '收票人邮箱',
    field: 'email',
    component: 'Input',
  },
  {
    label: '手机号',
    field: 'telephone',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },

];
